<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class MY_model extends CI_Model {

	public function __construct() {
		parent::__construct();
		$this->load->database();
	}
        
        protected function _sets_to_str($sets, $cols=array()) {
            $arr = array();
            foreach ($sets as $key => $val) {
                if ($cols && !in_array($key, $cols)) {
                    continue;;
                }
                $arr[] = "`$key` = '$val'";
            }
            return join(', ', $arr);
        }
	
}